<template>
  <div class="zhutifenlei content-wrapper">
    <div class="part-title">主体巡查分类统计</div>
    <chart :config="config" />
  </div>
</template>

<script>
import chart from './chart'
import { randomNum, handleNumber } from '@/utils'
import { bridge } from '@/mixin'
export default {
  components: { chart },
  mixins: [bridge],
  data() {
    return {
      config: {
        xAxisData: ['出租屋', '企业', '无营业执照', '小档口', '食药监餐饮服务'],
        seriesData: [],
        yAxis: {
          min: 0,
          max: 1,
          interval: 0.2,
        }
      }
    }
  },
  methods: {
    refreshData() {
      const dataLength = this.config.xAxisData.length
      const resData = randomNum({ max: 10000 }, dataLength)
      this.config.seriesData = resData
      this.config.yAxis.max = handleNumber(Math.max(...resData))
      this.config.yAxis.interval = this.config.yAxis.max / 5
    }
  },
}
</script>

<style lang="scss" scoped>
.zhutifenlei {
  width: 39.0909rem;
  height: 21.4545rem;
  background-image: url('~@/views/screen-1/images/zhutifenlei.png');
  background-size: cover;
  background-position: center center;
}
</style>
